﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Collections;
using System.Collections.ObjectModel;
using SYcwpb.Models;
using SYcwpb.Helpers;
using System.Data;

namespace SYcwpb.Access
{

    class DriverAttendanceOrderAdjustAccess
    {
        SqlDataLayer sqlHelper = new SqlDataLayer();

        string SQL_GetDriversByGroup = "";

        /// <summary>
        /// 返回指定班组的司机
        /// </summary>
        public ObservableCollection<DriverAttendanceOrderAdjustModel> GetDriversByGroup(string group)
        {
            ObservableCollection<DriverAttendanceOrderAdjustModel> _modelList;
            if (string.IsNullOrEmpty(group))
            {
                _modelList =
                new ObservableCollection<DriverAttendanceOrderAdjustModel>()
                {
                    DriverAttendanceOrderAdjustModel.CreateDriverAttendanceOrderAdjustModel("101","222","333","444","555","666","777","888"),
                    DriverAttendanceOrderAdjustModel.CreateDriverAttendanceOrderAdjustModel("102","222","333","444","555","666","777","888"),
                    DriverAttendanceOrderAdjustModel.CreateDriverAttendanceOrderAdjustModel("103","222","333","444","555","666","777","888"),
                    DriverAttendanceOrderAdjustModel.CreateDriverAttendanceOrderAdjustModel("104","222","333","444","555","666","777","888"),
                    DriverAttendanceOrderAdjustModel.CreateDriverAttendanceOrderAdjustModel("105","222","333","444","555","666","777","888"),
                    DriverAttendanceOrderAdjustModel.CreateDriverAttendanceOrderAdjustModel("106","222","333","444","555","666","777","888"),
                    DriverAttendanceOrderAdjustModel.CreateDriverAttendanceOrderAdjustModel("107","222","333","444","555","666","777","888"),
                    DriverAttendanceOrderAdjustModel.CreateDriverAttendanceOrderAdjustModel("108","222","333","444","555","666","777","888"),
                    DriverAttendanceOrderAdjustModel.CreateDriverAttendanceOrderAdjustModel("109","222","333","444","555","666","777","888"),
                    DriverAttendanceOrderAdjustModel.CreateDriverAttendanceOrderAdjustModel("110","222","333","444","555","666","777","888"),
                    DriverAttendanceOrderAdjustModel.CreateDriverAttendanceOrderAdjustModel("111","222","333","444","555","666","777","888"),
                };
            }
            else
            {
                _modelList =
                new ObservableCollection<DriverAttendanceOrderAdjustModel>()
                {
                    DriverAttendanceOrderAdjustModel.CreateDriverAttendanceOrderAdjustModel("101","222","333","444","555","666","777","888"),
                    DriverAttendanceOrderAdjustModel.CreateDriverAttendanceOrderAdjustModel("102","222","333","444","555","666","777","888"),
                };
            }
            return _modelList;

            //DataTable dt = sqlHelper.SelectDt(SQL_GetDriversByGroup);
            //if (null != dt && dt.Rows.Count > 0)
            //{
            //    for (int i = 0; i < dt.Rows.Count; i++)
            //        _modelList.Add(DriverAttendanceOrderAdjustModel.CreateDriverAttendanceOrderAdjustModel(
            //            //dt.Rows[i]["ID"].ToString(), 
            //            //dt.Rows[i]["TableName"].ToString()
            //            )
            //            );

            //}
            //return _modelList;
        }
    }
}
